/**
 * Created by mac on 16/6/29.
 */
var sqlite3 = require('sqlite3').verbose();
//var db = new sqlite3.Database(':memory:');
var openCb = function (error){ 
	if(!error){
		console.log("open db succeed!") 
	}
}
var db = new sqlite3.Database('haha.db', openCb );
/*
db.serialize(function() {

    db.run('CREATE TABLE IF NOT EXISTS lorem (info TEXT) ');
    var stmt = db.prepare('INSERT INTO lorem VALUES (?)');

    for (var i = 0; i < 10; i++) {
        stmt.run('Ipsum ' + i);
    }

    stmt.finalize();

    db.each('SELECT rowid AS id, info FROM lorem', function(err, row) {
        console.log(row.id + ': ' + row.info);
    });
});
*/
var closeCb = function (error){ 
	if(!error){
		console.log("close db succeed!") 
	}
}
db.close(closeCb);


